package com.situ.library.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.situ.library.dao.IBookDao;
import com.situ.library.dao.impl.BookDaoImpl;
import com.situ.library.pojo.entity.Book;

public class BookExcelListener extends AnalysisEventListener<Book> {
    private IBookDao bookDao = new BookDaoImpl();

    @Override
    public void invoke(Book book, AnalysisContext analysisContext) {
        System.out.println("BookExcelListener.invoke");
        System.out.println(book);
        bookDao.addExcel(book);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("BookExcelListener.doAfterAllAnalysed");
    }
}